﻿using System;
using System.Collections.Generic;
using System.Drawing.Drawing2D;
using System.Linq;
using Autodesk.Revit.ApplicationServices;
using Autodesk.Revit.DB;
using YJKRGeometry;
using YJKStairs.CommonUnit;
using YJKStairs.DataInfos;
using YJKStairs.Manage;

namespace YJKStairs.Kit
{
	public class MultiRunStairsKit : ProjectionDrawingKit
	{
		public MultiRunStairsKit(Autodesk.Revit.ApplicationServices.Application app) : base(app)
		{
		}

		private void SetStairsOutSupportPointsLeftUp(ref MultiRunStairs stairs, List<List<XYZ>> lstlstLandingPt)
		{
			List<LineRunData> lstRunData = stairs.m_lstRunData;
			stairs.m_listPointsSupport.Add(lstRunData[0].PtRunBottomLeft);
			stairs.m_listPointsSupport.Add(lstRunData[0].PtRunTopLeft);
			stairs.m_listPointsSupport.AddRange(lstlstLandingPt[0]);
			stairs.m_listPointsSupport.Add(lstRunData[1].PtRunTopRight);
			stairs.m_listPointsSupport.Add(lstRunData[1].PtRunBottomRight);
			stairs.m_listPointsSupport.Add(lstlstLandingPt[1][1]);
			stairs.m_listPointsSupport.Add(lstlstLandingPt[1][0]);
			stairs.m_listPointsSupport.Add(lstRunData[0].PtRunBottomLeft);
			stairs.m_listPointsSupport.Add(lstRunData[0].PtRunTopLeft);
			if (lstlstLandingPt.Count >= 3)
			{
				stairs.m_listPointsSupport.AddRange(lstlstLandingPt[2]);
			}
			if (lstRunData.Count == 4)
			{
				stairs.m_listPointsSupport.Add(lstRunData[3].PtRunTopRight);
				stairs.m_listPointsSupport.Add(lstRunData[3].PtRunBottomRight);
				if (lstlstLandingPt.Count == 4)
				{
					stairs.m_listPointsSupport.Add(lstlstLandingPt[3][1]);
					stairs.m_listPointsSupport.Add(lstlstLandingPt[3][0]);
				}
			}
		}

		private void SetStairsOutSupportPointsRightUp(ref MultiRunStairs stairs, List<List<XYZ>> lstlstLandingPt)
		{
			List<LineRunData> lstRunData = stairs.m_lstRunData;
			stairs.m_listPointsSupport.Add(lstRunData[0].PtRunBottomRight);
			stairs.m_listPointsSupport.Add(lstRunData[0].PtRunTopRight);
			stairs.m_listPointsSupport.Add(lstlstLandingPt[0][1]);
			stairs.m_listPointsSupport.Add(lstlstLandingPt[0][0]);
			stairs.m_listPointsSupport.Add(lstRunData[1].PtRunTopLeft);
			stairs.m_listPointsSupport.Add(lstRunData[1].PtRunBottomLeft);
			stairs.m_listPointsSupport.AddRange(lstlstLandingPt[1]);
			stairs.m_listPointsSupport.Add(lstRunData[0].PtRunBottomRight);
			stairs.m_listPointsSupport.Add(lstRunData[0].PtRunTopRight);
			if (lstlstLandingPt.Count >= 3)
			{
				stairs.m_listPointsSupport.Add(lstlstLandingPt[2][1]);
				stairs.m_listPointsSupport.Add(lstlstLandingPt[2][0]);
			}
			if (lstRunData.Count == 4)
			{
				stairs.m_listPointsSupport.Add(lstRunData[3].PtRunTopLeft);
				stairs.m_listPointsSupport.Add(lstRunData[3].PtRunBottomLeft);
				if (lstlstLandingPt.Count == 4)
				{
					stairs.m_listPointsSupport.AddRange(lstlstLandingPt[3]);
				}
			}
		}

		private void CalcRunPosition(ref MultiRunStairs stairs, ref List<double> lstLandingWidth, bool bLeftSideUp)
		{
			List<LineRunData> lstRunData = stairs.m_lstRunData;
			int count = lstRunData.Count;
			BaseLandingData landData = stairs.m_LandData;
			double stairsWellWidth = stairs.GetStairsWellWidth();
			double width = landData.Width;
			double dStairsWidth = stairs.m_dStairsWidth;
			double dStairsLength = stairs.m_dStairsLength;
			double num = (dStairsWidth - stairsWellWidth) / 2.0;
			int num2 = 1;
			double val = lstRunData[0].RunLength;
			for (int i = 1; i < count; i++)
			{
				double runLength = lstRunData[i].RunLength;
				if (YJKRGeometry.Geometry.GreaterThan(runLength, val))
				{
					num2 = i + 1;
					val = runLength;
				}
			}
			if (bLeftSideUp)
			{
				if (num2 == 1)
				{
					this.CalcRunPositionWhenRun1MaxLeftUp(ref stairs, ref lstLandingWidth);
				}
				else if (num2 == 2)
				{
					this.CalcRunPositionWhenRun2MaxLeftUp(ref stairs, ref lstLandingWidth);
				}
				else if (num2 == 3)
				{
					this.CalcRunPositionWhenRun3MaxLeftUp(ref stairs, ref lstLandingWidth);
				}
				else
				{
					this.CalcRunPositionWhenRun4MaxLeftUp(ref stairs, ref lstLandingWidth);
				}
			}
			else if (num2 == 1)
			{
				this.CalcRunPositionWhenRun1MaxRightUp(ref stairs, ref lstLandingWidth);
			}
			else if (num2 == 2)
			{
				this.CalcRunPositionWhenRun2MaxRightUp(ref stairs, ref lstLandingWidth);
			}
			else if (num2 == 3)
			{
				this.CalcRunPositionWhenRun3MaxRightUp(ref stairs, ref lstLandingWidth);
			}
			else
			{
				this.CalcRunPositionWhenRun4MaxRightUp(ref stairs, ref lstLandingWidth);
			}
			stairs.m_arLandWidth = new List<string>();
			foreach (double val2 in lstLandingWidth)
			{
				stairs.m_arLandWidth.Add(Common.FeetToMM(val2).ToString());
			}
		}

		private void CalcRunPositionWhenRun1MaxLeftUp(ref MultiRunStairs stairs, ref List<double> lstLandingWidth)
		{
			double num = stairs.m_dStairsLength;
			BaseLandingData landData = stairs.m_LandData;
			List<LineRunData> lstRunData = stairs.m_lstRunData;
			LineRunData lineRunData = lstRunData.First<LineRunData>();
			double runLength = lineRunData.RunLength;
			double num2 = (num - runLength) / 2.0;
			if (YJKRGeometry.Geometry.GreaterThan(landData.Width, num2))
			{
				num += (landData.Width - num2) * 2.0;
				stairs.m_dStairsLength = num;
				num2 = landData.Width;
			}
			int num3 = stairs.m_nRunNum;
			if (!stairs.m_bHasTopLanding)
			{
				num3--;
			}
			for (int i = 0; i < num3; i++)
			{
				lstLandingWidth.Add(num2);
			}
			XYZ xyz = new XYZ(0.0, num2, 0.0);
			XYZ xyz2 = new XYZ(lineRunData.RunWidth, 0.0, 0.0);
			XYZ xyz3 = new XYZ(stairs.m_dWellWidth, 0.0, 0.0);
			XYZ xyz4 = new XYZ(0.0, lineRunData.RunLength, 0.0);
			XYZ xyz5 = XYZ.Zero;
			xyz5 += xyz;
			XYZ xyz6 = xyz5 + xyz2;
			XYZ xyz7 = xyz5 + xyz4;
			XYZ xyz8 = xyz6 + xyz4;
			lineRunData.PtRunBottomLeft = xyz5;
			lineRunData.PtRunBottomRight = xyz6;
			lineRunData.PtRunTopLeft = xyz7;
			lineRunData.PtRunTopRight = xyz8;
			LineRunData lineRunData2 = lstRunData[1];
			xyz4 = new XYZ(0.0, lineRunData2.RunLength, 0.0);
			double num4 = num - lineRunData2.RunLength - num2;
			if (YJKRGeometry.Geometry.GreaterThan(landData.Width, num4))
			{
				num4 = landData.Width;
			}
			xyz7 = xyz8 + xyz3;
			xyz8 = xyz7 + xyz2;
			xyz5 = xyz7 - xyz4;
			xyz6 = xyz8 - xyz4;
			lineRunData2.PtRunBottomLeft = xyz5;
			lineRunData2.PtRunBottomRight = xyz6;
			lineRunData2.PtRunTopLeft = xyz7;
			lineRunData2.PtRunTopRight = xyz8;
			num2 = num4;
			lstLandingWidth[1] = num2;
			stairs.m_lstRunData[0] = lineRunData;
			stairs.m_lstRunData[1] = lineRunData2;
			this.Cal3And4RunPositionLeftUp(ref stairs, ref lstLandingWidth, xyz5);
		}

		private void Cal3And4RunPositionLeftUp(ref MultiRunStairs stairs, ref List<double> lstLandingWidth, XYZ ptRun3Base)
		{
			double dStairsLength = stairs.m_dStairsLength;
			BaseLandingData landData = stairs.m_LandData;
			List<LineRunData> lstRunData = stairs.m_lstRunData;
			XYZ xyz = new XYZ(stairs.m_dWellWidth, 0.0, 0.0);
			LineRunData lineRunData = lstRunData[2];
			XYZ xyz2 = new XYZ(lineRunData.RunWidth, 0.0, 0.0);
			XYZ xyz3 = new XYZ(0.0, lineRunData.RunLength, 0.0);
			double num = dStairsLength - lineRunData.RunLength - lstLandingWidth[1];
			if (YJKRGeometry.Geometry.GreaterThan(landData.Width, num))
			{
				num = landData.Width;
			}
			XYZ xyz4 = ptRun3Base - xyz;
			XYZ xyz5 = xyz4 - xyz2;
			XYZ xyz6 = xyz5 + xyz3;
			XYZ xyz7 = xyz4 + xyz3;
			lineRunData.PtRunBottomLeft = xyz5;
			lineRunData.PtRunBottomRight = xyz4;
			lineRunData.PtRunTopLeft = xyz6;
			lineRunData.PtRunTopRight = xyz7;
			double num2 = num;
			if (lstLandingWidth.Count >= 3)
			{
				lstLandingWidth[2] = num2;
			}
			stairs.m_lstRunData[2] = lineRunData;
			if (stairs.m_nRunNum == 4)
			{
				LineRunData lineRunData2 = lstRunData[3];
				xyz3 = new XYZ(0.0, lineRunData2.RunLength, 0.0);
				num = dStairsLength - lineRunData2.RunLength - num2;
				if (YJKRGeometry.Geometry.GreaterThan(landData.Width, num))
				{
					num = landData.Width;
				}
				xyz6 = xyz7 + xyz;
				xyz7 = xyz6 + xyz2;
				xyz5 = xyz6 - xyz3;
				xyz4 = xyz7 - xyz3;
				lineRunData2.PtRunBottomLeft = xyz5;
				lineRunData2.PtRunBottomRight = xyz4;
				lineRunData2.PtRunTopLeft = xyz6;
				lineRunData2.PtRunTopRight = xyz7;
				if (stairs.m_bHasTopLanding)
				{
					lstLandingWidth[3] = num;
				}
				stairs.m_lstRunData[3] = lineRunData2;
			}
		}

		private void CalcRunPositionWhenRun2MaxLeftUp(ref MultiRunStairs stairs, ref List<double> lstLandingWidth)
		{
			double num = stairs.m_dStairsLength;
			BaseLandingData landData = stairs.m_LandData;
			List<LineRunData> lstRunData = stairs.m_lstRunData;
			LineRunData lineRunData = lstRunData[1];
			double num2 = (stairs.m_dStairsLength - lineRunData.RunLength) / 2.0;
			if (YJKRGeometry.Geometry.GreaterThan(landData.Width, num2))
			{
				num += (landData.Width - num2) * 2.0;
				stairs.m_dStairsLength = num;
				num2 = landData.Width;
			}
			int num3 = stairs.m_nRunNum;
			if (!stairs.m_bHasTopLanding)
			{
				num3--;
			}
			for (int i = 0; i < num3; i++)
			{
				lstLandingWidth.Add(num2);
			}
			XYZ xyz = new XYZ(0.0, num2, 0.0);
			XYZ xyz2 = new XYZ(lineRunData.RunWidth, 0.0, 0.0);
			XYZ xyz3 = new XYZ(stairs.m_dWellWidth, 0.0, 0.0);
			XYZ xyz4 = new XYZ(0.0, lineRunData.RunLength, 0.0);
			XYZ xyz5 = XYZ.Zero;
			xyz5 += xyz;
			xyz5 += xyz2;
			xyz5 += xyz3;
			XYZ ptRun3Base = xyz5;
			XYZ xyz6 = xyz5 + xyz2;
			XYZ xyz7 = xyz5 + xyz4;
			XYZ xyz8 = xyz6 + xyz4;
			lineRunData.PtRunBottomLeft = xyz5;
			lineRunData.PtRunBottomRight = xyz6;
			lineRunData.PtRunTopLeft = xyz7;
			lineRunData.PtRunTopRight = xyz8;
			LineRunData lineRunData2 = lstRunData[0];
			xyz4 = new XYZ(0.0, lineRunData2.RunLength, 0.0);
			xyz8 = xyz7 - xyz3;
			xyz7 = xyz8 - xyz2;
			xyz5 = xyz7 - xyz4;
			xyz6 = xyz8 - xyz4;
			lineRunData2.PtRunBottomLeft = xyz5;
			lineRunData2.PtRunBottomRight = xyz6;
			lineRunData2.PtRunTopLeft = xyz7;
			lineRunData2.PtRunTopRight = xyz8;
			stairs.m_lstRunData[0] = lineRunData2;
			stairs.m_lstRunData[1] = lineRunData;
			this.Cal3And4RunPositionLeftUp(ref stairs, ref lstLandingWidth, ptRun3Base);
		}

		private void CalcRunPositionWhenRun3MaxLeftUp(ref MultiRunStairs stairs, ref List<double> lstLandingWidth)
		{
			double num = stairs.m_dStairsLength;
			BaseLandingData landData = stairs.m_LandData;
			List<LineRunData> lstRunData = stairs.m_lstRunData;
			LineRunData lineRunData = lstRunData[2];
			double runLength = lineRunData.RunLength;
			double num2 = num - runLength;
			if (stairs.m_bHasTopLanding || lstRunData.Count == 4)
			{
				num2 = (num - runLength) / 2.0;
			}
			else
			{
				num2 = num - runLength;
			}
			if (YJKRGeometry.Geometry.GreaterThan(landData.Width, num2))
			{
				if (stairs.m_bHasTopLanding)
				{
					num += (landData.Width - num2) * 2.0;
				}
				else
				{
					num += landData.Width - num2;
				}
				stairs.m_dStairsLength = num;
				num2 = landData.Width;
			}
			int num3 = stairs.m_nRunNum;
			if (!stairs.m_bHasTopLanding)
			{
				num3--;
			}
			for (int i = 0; i < num3; i++)
			{
				lstLandingWidth.Add(num2);
			}
			XYZ xyz = new XYZ(0.0, 0.0, 0.0);
			xyz = new XYZ(0.0, num2, 0.0);
			XYZ xyz2 = new XYZ(lineRunData.RunWidth, 0.0, 0.0);
			XYZ xyz3 = new XYZ(stairs.m_dWellWidth, 0.0, 0.0);
			XYZ xyz4 = new XYZ(0.0, lineRunData.RunLength, 0.0);
			XYZ xyz5 = XYZ.Zero;
			xyz5 += xyz;
			XYZ xyz6 = xyz5 + xyz2;
			XYZ xyz7 = xyz5 + xyz4;
			XYZ xyz8 = xyz6 + xyz4;
			lineRunData.PtRunBottomLeft = xyz5;
			lineRunData.PtRunBottomRight = xyz6;
			lineRunData.PtRunTopLeft = xyz7;
			lineRunData.PtRunTopRight = xyz8;
			stairs.m_lstRunData[2] = lineRunData;
			XYZ ptRun2Base = xyz6;
			if (stairs.m_nRunNum == 4)
			{
				LineRunData lineRunData2 = lstRunData[3];
				xyz4 = new XYZ(0.0, lineRunData2.RunLength, 0.0);
				xyz7 = xyz8 + xyz3;
				xyz8 = xyz7 + xyz2;
				xyz5 = xyz7 - xyz4;
				xyz6 = xyz8 - xyz4;
				lineRunData2.PtRunBottomLeft = xyz5;
				lineRunData2.PtRunBottomRight = xyz6;
				lineRunData2.PtRunTopLeft = xyz7;
				lineRunData2.PtRunTopRight = xyz8;
				stairs.m_lstRunData[3] = lineRunData2;
				if (stairs.m_bHasTopLanding)
				{
					num2 = stairs.m_dStairsLength - lineRunData2.RunLength;
					if (YJKRGeometry.Geometry.GreaterThan(landData.Width, num2))
					{
						num2 = landData.Width;
					}
					lstLandingWidth[3] = num2;
				}
			}
			this.Cal1And2RunPositionLeftUp(ref stairs, ref lstLandingWidth, ptRun2Base);
		}

		private void Cal1And2RunPositionLeftUp(ref MultiRunStairs stairs, ref List<double> lstLandingWidth, XYZ ptRun2Base)
		{
			double dStairsLength = stairs.m_dStairsLength;
			BaseLandingData landData = stairs.m_LandData;
			List<LineRunData> lstRunData = stairs.m_lstRunData;
			XYZ xyz = new XYZ(stairs.m_dWellWidth, 0.0, 0.0);
			LineRunData lineRunData = lstRunData[1];
			XYZ xyz2 = new XYZ(lineRunData.RunWidth, 0.0, 0.0);
			XYZ xyz3 = new XYZ(0.0, lineRunData.RunLength, 0.0);
			XYZ xyz4 = ptRun2Base + xyz;
			XYZ xyz5 = xyz4 + xyz2;
			XYZ xyz6 = xyz4 + xyz3;
			XYZ xyz7 = xyz5 + xyz3;
			lineRunData.PtRunBottomLeft = xyz4;
			lineRunData.PtRunBottomRight = xyz5;
			lineRunData.PtRunTopLeft = xyz6;
			lineRunData.PtRunTopRight = xyz7;
			stairs.m_lstRunData[1] = lineRunData;
			double num = stairs.m_dStairsLength - lstLandingWidth[1] - lineRunData.RunLength;
			if (YJKRGeometry.Geometry.GreaterThan(landData.Width, num))
			{
				num = landData.Width;
			}
			lstLandingWidth[0] = num;
			LineRunData lineRunData2 = lstRunData[0];
			xyz3 = new XYZ(0.0, lineRunData2.RunLength, 0.0);
			xyz7 = xyz6 - xyz;
			xyz6 = xyz7 - xyz2;
			xyz4 = xyz6 - xyz3;
			xyz5 = xyz7 - xyz3;
			lineRunData2.PtRunBottomLeft = xyz4;
			lineRunData2.PtRunBottomRight = xyz5;
			lineRunData2.PtRunTopLeft = xyz6;
			lineRunData2.PtRunTopRight = xyz7;
			stairs.m_lstRunData[0] = lineRunData2;
		}

		private void CalcRunPositionWhenRun4MaxLeftUp(ref MultiRunStairs stairs, ref List<double> lstLandingWidth)
		{
			double num = stairs.m_dStairsLength;
			BaseLandingData landData = stairs.m_LandData;
			List<LineRunData> lstRunData = stairs.m_lstRunData;
			LineRunData lineRunData = lstRunData[3];
			double runLength = lineRunData.RunLength;
			double num2 = num - runLength;
			if (stairs.m_bHasTopLanding)
			{
				num2 = (num - runLength) / 2.0;
			}
			if (YJKRGeometry.Geometry.GreaterThan(landData.Width, num2))
			{
				if (stairs.m_bHasTopLanding)
				{
					num += (landData.Width - num2) * 2.0;
				}
				else
				{
					num += landData.Width - num2;
				}
				stairs.m_dStairsLength = num;
				num2 = landData.Width;
			}
			int num3 = stairs.m_nRunNum;
			if (!stairs.m_bHasTopLanding)
			{
				num3--;
			}
			for (int i = 0; i < num3; i++)
			{
				lstLandingWidth.Add(num2);
			}
			XYZ xyz = new XYZ(0.0, 0.0, 0.0);
			if (stairs.m_bHasTopLanding)
			{
				xyz = new XYZ(0.0, num2, 0.0);
			}
			XYZ xyz2 = new XYZ(lineRunData.RunWidth, 0.0, 0.0);
			XYZ xyz3 = new XYZ(stairs.m_dWellWidth, 0.0, 0.0);
			XYZ xyz4 = new XYZ(0.0, lineRunData.RunLength, 0.0);
			XYZ xyz5 = XYZ.Zero;
			xyz5 += xyz;
			xyz5 += xyz2;
			xyz5 += xyz3;
			XYZ xyz6 = xyz5 + xyz2;
			XYZ xyz7 = xyz5 + xyz4;
			XYZ xyz8 = xyz6 + xyz4;
			lineRunData.PtRunBottomLeft = xyz5;
			lineRunData.PtRunBottomRight = xyz6;
			lineRunData.PtRunTopLeft = xyz7;
			lineRunData.PtRunTopRight = xyz8;
			stairs.m_lstRunData[3] = lineRunData;
			LineRunData lineRunData2 = lstRunData[2];
			xyz4 = new XYZ(0.0, lineRunData2.RunLength, 0.0);
			xyz8 = xyz7 - xyz3;
			xyz7 = xyz8 - xyz2;
			xyz5 = xyz7 - xyz4;
			xyz6 = xyz8 - xyz4;
			lineRunData2.PtRunBottomLeft = xyz5;
			lineRunData2.PtRunBottomRight = xyz6;
			lineRunData2.PtRunTopLeft = xyz7;
			lineRunData2.PtRunTopRight = xyz8;
			stairs.m_lstRunData[2] = lineRunData2;
			num2 = num - lineRunData2.RunLength - lstLandingWidth[2];
			if (YJKRGeometry.Geometry.GreaterThan(landData.Width, num2))
			{
				num2 = landData.Width;
			}
			lstLandingWidth[1] = num2;
			this.Cal1And2RunPositionLeftUp(ref stairs, ref lstLandingWidth, xyz6);
		}

		private void CorrectLandWidth(ref MultiRunStairs stairs, ref List<double> lstLandingWidth)
		{
			List<LineRunData> lstRunData = stairs.m_lstRunData;
			XYZ xyz = new XYZ(0.0, lstLandingWidth[0], 0.0);
			new List<XYZ>();
			XYZ xyz2 = lstRunData[0].PtRunTopLeft + xyz;
			XYZ xyz3 = lstRunData[2].PtRunTopLeft;
			if (lstLandingWidth.Count >= 3)
			{
				xyz = new XYZ(0.0, lstLandingWidth[2], 0.0);
				xyz3 += xyz;
			}
			if (YJKRGeometry.Geometry.GreaterThan(xyz2.Y, xyz3.Y))
			{
				if (lstLandingWidth.Count >= 3)
				{
					List<double> list = lstLandingWidth;
					list[2] = list[2] + (xyz2.Y - xyz3.Y);
				}
			}
			else if (YJKRGeometry.Geometry.GreaterThan(xyz3.Y, xyz2.Y))
			{
				List<double> list = lstLandingWidth;
				list[0] = list[0] + (xyz3.Y - xyz2.Y);
			}
			if (lstRunData.Count > 3)
			{
				xyz = new XYZ(0.0, lstLandingWidth[1], 0.0);
				XYZ xyz4 = lstRunData[1].PtRunBottomRight - xyz;
				XYZ xyz5 = lstRunData[3].PtRunBottomRight;
				if (lstLandingWidth.Count == 4)
				{
					xyz = new XYZ(0.0, lstLandingWidth[3], 0.0);
					xyz5 -= xyz;
				}
				if (YJKRGeometry.Geometry.GreaterThan(xyz4.Y, xyz5.Y))
				{
					List<double> list = lstLandingWidth;
					list[1] = list[1] + (xyz4.Y - xyz5.Y);
					this.MoveStairsByCorrectLanding(-(xyz4.Y - xyz5.Y), ref stairs);
					return;
				}
				if (YJKRGeometry.Geometry.GreaterThan(xyz5.Y, xyz4.Y) && lstLandingWidth.Count == 4)
				{
					List<double> list = lstLandingWidth;
					list[3] = list[3] + (xyz5.Y - xyz4.Y);
					this.MoveStairsByCorrectLanding(-(xyz5.Y - xyz4.Y), ref stairs);
				}
			}
		}

		private void MoveStairsByCorrectLanding(double doffset, ref MultiRunStairs stairs)
		{
			List<LineRunData> lstRunData = stairs.m_lstRunData;
			foreach (LineRunData lineRunData in lstRunData)
			{
				lineRunData.PtRunBottomLeft += XYZ.BasisY * doffset;
				lineRunData.PtRunBottomRight += XYZ.BasisY * doffset;
				lineRunData.PtRunTopLeft += XYZ.BasisY * doffset;
				lineRunData.PtRunTopRight += XYZ.BasisY * doffset;
			}
			stairs.m_lstRunData = lstRunData;
		}

		private void CalcRectLandTopPosLeftUp(MultiRunStairs stairs, List<double> lstLandingWidth, ref List<List<XYZ>> lstlstLandingPos)
		{
			List<LineRunData> lstRunData = stairs.m_lstRunData;
			XYZ xyz = new XYZ(0.0, lstLandingWidth[0], 0.0);
			List<XYZ> list = new List<XYZ>();
			XYZ xyz2 = lstRunData[0].PtRunTopLeft + xyz;
			XYZ xyz3 = lstRunData[1].PtRunTopRight + xyz;
			list.Add(xyz2);
			list.Add(xyz3);
			lstlstLandingPos.Add(list);
			xyz = new XYZ(0.0, lstLandingWidth[1], 0.0);
			List<XYZ> list2 = new List<XYZ>();
			xyz2 = lstRunData[2].PtRunBottomLeft - xyz;
			xyz3 = lstRunData[1].PtRunBottomRight - xyz;
			list2.Add(xyz2);
			list2.Add(xyz3);
			lstlstLandingPos.Add(list2);
			if (lstLandingWidth.Count >= 3)
			{
				xyz = new XYZ(0.0, lstLandingWidth[2], 0.0);
				List<XYZ> list3 = new List<XYZ>();
				xyz2 = lstRunData[2].PtRunTopLeft + xyz;
				xyz = new XYZ(stairs.m_dStairsWidth, 0.0, 0.0);
				xyz3 = xyz2 + xyz;
				list3.Add(xyz2);
				list3.Add(xyz3);
				lstlstLandingPos.Add(list3);
			}
			if (lstLandingWidth.Count == 4)
			{
				xyz = new XYZ(0.0, lstLandingWidth[3], 0.0);
				List<XYZ> list4 = new List<XYZ>();
				xyz3 = lstRunData[3].PtRunBottomRight - xyz;
				xyz = new XYZ(stairs.m_dStairsWidth, 0.0, 0.0);
				xyz2 = xyz3 - xyz;
				list4.Add(xyz2);
				list4.Add(xyz3);
				lstlstLandingPos.Add(list4);
			}
		}

		private void CalcRunPositionWhenRun1MaxRightUp(ref MultiRunStairs stairs, ref List<double> lstLandingWidth)
		{
			double num = stairs.m_dStairsLength;
			BaseLandingData landData = stairs.m_LandData;
			List<LineRunData> lstRunData = stairs.m_lstRunData;
			LineRunData lineRunData = lstRunData.First<LineRunData>();
			double runLength = lineRunData.RunLength;
			double num2 = (num - runLength) / 2.0;
			if (YJKRGeometry.Geometry.GreaterThan(landData.Width, num2))
			{
				num += (landData.Width - num2) * 2.0;
				stairs.m_dStairsLength = num;
				num2 = landData.Width;
			}
			int num3 = stairs.m_nRunNum;
			if (!stairs.m_bHasTopLanding)
			{
				num3--;
			}
			for (int i = 0; i < num3; i++)
			{
				lstLandingWidth.Add(num2);
			}
			XYZ xyz = new XYZ(0.0, num2, 0.0);
			XYZ xyz2 = new XYZ(lineRunData.RunWidth, 0.0, 0.0);
			XYZ xyz3 = new XYZ(stairs.m_dWellWidth, 0.0, 0.0);
			XYZ xyz4 = new XYZ(0.0, lineRunData.RunLength, 0.0);
			XYZ xyz5 = new XYZ(stairs.m_dStairsWidth, 0.0, 0.0) + xyz;
			XYZ xyz6 = xyz5 - xyz2;
			XYZ xyz7 = xyz6 + xyz4;
			XYZ xyz8 = xyz5 + xyz4;
			lineRunData.PtRunBottomLeft = xyz6;
			lineRunData.PtRunBottomRight = xyz5;
			lineRunData.PtRunTopLeft = xyz7;
			lineRunData.PtRunTopRight = xyz8;
			LineRunData lineRunData2 = lstRunData[1];
			xyz4 = new XYZ(0.0, lineRunData2.RunLength, 0.0);
			double num4 = num - lineRunData2.RunLength - num2;
			if (YJKRGeometry.Geometry.GreaterThan(landData.Width, num4))
			{
				num4 = landData.Width;
			}
			xyz8 = xyz7 - xyz3;
			xyz7 = xyz8 - xyz2;
			xyz6 = xyz7 - xyz4;
			xyz5 = xyz8 - xyz4;
			lineRunData2.PtRunBottomLeft = xyz6;
			lineRunData2.PtRunBottomRight = xyz5;
			lineRunData2.PtRunTopLeft = xyz7;
			lineRunData2.PtRunTopRight = xyz8;
			num2 = num4;
			lstLandingWidth[1] = num2;
			stairs.m_lstRunData[0] = lineRunData;
			stairs.m_lstRunData[1] = lineRunData2;
			this.Cal3And4RunPositionRightUp(ref stairs, ref lstLandingWidth, xyz5);
		}

		private void Cal3And4RunPositionRightUp(ref MultiRunStairs stairs, ref List<double> lstLandingWidth, XYZ ptRun3Base)
		{
			double dStairsLength = stairs.m_dStairsLength;
			BaseLandingData landData = stairs.m_LandData;
			List<LineRunData> lstRunData = stairs.m_lstRunData;
			XYZ xyz = new XYZ(stairs.m_dWellWidth, 0.0, 0.0);
			LineRunData lineRunData = lstRunData[2];
			XYZ xyz2 = new XYZ(lineRunData.RunWidth, 0.0, 0.0);
			XYZ xyz3 = new XYZ(0.0, lineRunData.RunLength, 0.0);
			double num = dStairsLength - lineRunData.RunLength - lstLandingWidth[1];
			if (YJKRGeometry.Geometry.GreaterThan(landData.Width, num))
			{
				num = landData.Width;
			}
			XYZ xyz4 = ptRun3Base + xyz;
			XYZ xyz5 = xyz4 + xyz2;
			XYZ xyz6 = xyz4 + xyz3;
			XYZ xyz7 = xyz5 + xyz3;
			lineRunData.PtRunBottomLeft = xyz4;
			lineRunData.PtRunBottomRight = xyz5;
			lineRunData.PtRunTopLeft = xyz6;
			lineRunData.PtRunTopRight = xyz7;
			double num2 = num;
			if (lstLandingWidth.Count >= 3)
			{
				lstLandingWidth[2] = num2;
			}
			stairs.m_lstRunData[2] = lineRunData;
			if (stairs.m_nRunNum == 4)
			{
				LineRunData lineRunData2 = lstRunData[3];
				xyz3 = new XYZ(0.0, lineRunData2.RunLength, 0.0);
				num = dStairsLength - lineRunData2.RunLength - num2;
				if (YJKRGeometry.Geometry.GreaterThan(landData.Width, num))
				{
					num = landData.Width;
				}
				xyz7 = xyz6 - xyz;
				xyz6 = xyz7 - xyz2;
				xyz4 = xyz6 - xyz3;
				xyz5 = xyz7 - xyz3;
				lineRunData2.PtRunBottomLeft = xyz4;
				lineRunData2.PtRunBottomRight = xyz5;
				lineRunData2.PtRunTopLeft = xyz6;
				lineRunData2.PtRunTopRight = xyz7;
				if (stairs.m_bHasTopLanding)
				{
					lstLandingWidth[3] = num;
				}
				stairs.m_lstRunData[3] = lineRunData2;
			}
		}

		private void CalcRunPositionWhenRun2MaxRightUp(ref MultiRunStairs stairs, ref List<double> lstLandingWidth)
		{
			double num = stairs.m_dStairsLength;
			BaseLandingData landData = stairs.m_LandData;
			List<LineRunData> lstRunData = stairs.m_lstRunData;
			LineRunData lineRunData = lstRunData[1];
			double num2 = (stairs.m_dStairsLength - lineRunData.RunLength) / 2.0;
			if (YJKRGeometry.Geometry.GreaterThan(landData.Width, num2))
			{
				num += (landData.Width - num2) * 2.0;
				stairs.m_dStairsLength = num;
				num2 = landData.Width;
			}
			int num3 = stairs.m_nRunNum;
			if (!stairs.m_bHasTopLanding)
			{
				num3--;
			}
			for (int i = 0; i < num3; i++)
			{
				lstLandingWidth.Add(num2);
			}
			XYZ xyz = new XYZ(0.0, num2, 0.0);
			XYZ xyz2 = new XYZ(lineRunData.RunWidth, 0.0, 0.0);
			XYZ xyz3 = new XYZ(stairs.m_dWellWidth, 0.0, 0.0);
			XYZ xyz4 = new XYZ(0.0, lineRunData.RunLength, 0.0);
			XYZ xyz5 = XYZ.Zero;
			xyz5 += xyz;
			XYZ xyz6 = xyz5 + xyz2;
			XYZ ptRun3Base = xyz6;
			XYZ xyz7 = xyz5 + xyz4;
			XYZ xyz8 = xyz6 + xyz4;
			lineRunData.PtRunBottomLeft = xyz5;
			lineRunData.PtRunBottomRight = xyz6;
			lineRunData.PtRunTopLeft = xyz7;
			lineRunData.PtRunTopRight = xyz8;
			LineRunData lineRunData2 = lstRunData[0];
			xyz4 = new XYZ(0.0, lineRunData2.RunLength, 0.0);
			xyz7 = xyz8 + xyz3;
			xyz8 = xyz7 + xyz2;
			xyz5 = xyz7 - xyz4;
			xyz6 = xyz8 - xyz4;
			lineRunData2.PtRunBottomLeft = xyz5;
			lineRunData2.PtRunBottomRight = xyz6;
			lineRunData2.PtRunTopLeft = xyz7;
			lineRunData2.PtRunTopRight = xyz8;
			stairs.m_lstRunData[0] = lineRunData2;
			stairs.m_lstRunData[1] = lineRunData;
			this.Cal3And4RunPositionRightUp(ref stairs, ref lstLandingWidth, ptRun3Base);
		}

		private void CalcRunPositionWhenRun3MaxRightUp(ref MultiRunStairs stairs, ref List<double> lstLandingWidth)
		{
			double num = stairs.m_dStairsLength;
			BaseLandingData landData = stairs.m_LandData;
			List<LineRunData> lstRunData = stairs.m_lstRunData;
			LineRunData lineRunData = lstRunData[2];
			double runLength = lineRunData.RunLength;
			double num2 = num - runLength;
			if (stairs.m_bHasTopLanding)
			{
				num2 = (num - runLength) / 2.0;
			}
			if (YJKRGeometry.Geometry.GreaterThan(landData.Width, num2))
			{
				if (stairs.m_bHasTopLanding)
				{
					num += (landData.Width - num2) * 2.0;
				}
				else
				{
					num += landData.Width - num2;
				}
				stairs.m_dStairsLength = num;
				num2 = landData.Width;
			}
			int num3 = stairs.m_nRunNum;
			if (!stairs.m_bHasTopLanding)
			{
				num3--;
			}
			for (int i = 0; i < num3; i++)
			{
				lstLandingWidth.Add(num2);
			}
			XYZ xyz = new XYZ(0.0, 0.0, 0.0);
			xyz = new XYZ(0.0, num2, 0.0);
			XYZ xyz2 = new XYZ(lineRunData.RunWidth, 0.0, 0.0);
			XYZ xyz3 = new XYZ(stairs.m_dWellWidth, 0.0, 0.0);
			XYZ xyz4 = new XYZ(0.0, lineRunData.RunLength, 0.0);
			XYZ xyz5 = new XYZ(stairs.m_dStairsWidth, 0.0, 0.0);
			xyz5 += xyz;
			XYZ xyz6 = xyz5 - xyz2;
			XYZ xyz7 = xyz6 + xyz4;
			XYZ xyz8 = xyz5 + xyz4;
			lineRunData.PtRunBottomLeft = xyz6;
			lineRunData.PtRunBottomRight = xyz5;
			lineRunData.PtRunTopLeft = xyz7;
			lineRunData.PtRunTopRight = xyz8;
			stairs.m_lstRunData[2] = lineRunData;
			XYZ ptRun2Base = xyz6;
			if (stairs.m_nRunNum == 4)
			{
				LineRunData lineRunData2 = lstRunData[3];
				xyz4 = new XYZ(0.0, lineRunData2.RunLength, 0.0);
				xyz8 = xyz7 - xyz3;
				xyz7 = xyz8 - xyz2;
				xyz6 = xyz7 - xyz4;
				xyz5 = xyz8 - xyz4;
				lineRunData2.PtRunBottomLeft = xyz6;
				lineRunData2.PtRunBottomRight = xyz5;
				lineRunData2.PtRunTopLeft = xyz7;
				lineRunData2.PtRunTopRight = xyz8;
				stairs.m_lstRunData[3] = lineRunData2;
				if (stairs.m_bHasTopLanding)
				{
					num2 = stairs.m_dStairsLength - lineRunData2.RunLength;
					if (YJKRGeometry.Geometry.GreaterThan(landData.Width, num2))
					{
						num2 = landData.Width;
					}
					lstLandingWidth[3] = num2;
				}
			}
			this.Cal1And2RunPositionRightUp(ref stairs, ref lstLandingWidth, ptRun2Base);
		}

		private void Cal1And2RunPositionRightUp(ref MultiRunStairs stairs, ref List<double> lstLandingWidth, XYZ ptRun2Base)
		{
			double dStairsLength = stairs.m_dStairsLength;
			BaseLandingData landData = stairs.m_LandData;
			List<LineRunData> lstRunData = stairs.m_lstRunData;
			XYZ xyz = new XYZ(stairs.m_dWellWidth, 0.0, 0.0);
			LineRunData lineRunData = lstRunData[1];
			XYZ xyz2 = new XYZ(lineRunData.RunWidth, 0.0, 0.0);
			XYZ xyz3 = new XYZ(0.0, lineRunData.RunLength, 0.0);
			XYZ xyz4 = ptRun2Base - xyz;
			XYZ xyz5 = xyz4 - xyz2;
			XYZ xyz6 = xyz5 + xyz3;
			XYZ xyz7 = xyz4 + xyz3;
			lineRunData.PtRunBottomLeft = xyz5;
			lineRunData.PtRunBottomRight = xyz4;
			lineRunData.PtRunTopLeft = xyz6;
			lineRunData.PtRunTopRight = xyz7;
			stairs.m_lstRunData[1] = lineRunData;
			double num = stairs.m_dStairsLength - lstLandingWidth[1] - lineRunData.RunLength;
			if (YJKRGeometry.Geometry.GreaterThan(landData.Width, num))
			{
				num = landData.Width;
			}
			lstLandingWidth[0] = num;
			LineRunData lineRunData2 = lstRunData[0];
			xyz3 = new XYZ(0.0, lineRunData2.RunLength, 0.0);
			xyz6 = xyz7 + xyz;
			xyz7 = xyz6 + xyz2;
			xyz5 = xyz6 - xyz3;
			xyz4 = xyz7 - xyz3;
			lineRunData2.PtRunBottomLeft = xyz5;
			lineRunData2.PtRunBottomRight = xyz4;
			lineRunData2.PtRunTopLeft = xyz6;
			lineRunData2.PtRunTopRight = xyz7;
			stairs.m_lstRunData[0] = lineRunData2;
		}

		private void CalcRunPositionWhenRun4MaxRightUp(ref MultiRunStairs stairs, ref List<double> lstLandingWidth)
		{
			double num = stairs.m_dStairsLength;
			BaseLandingData landData = stairs.m_LandData;
			List<LineRunData> lstRunData = stairs.m_lstRunData;
			LineRunData lineRunData = lstRunData[3];
			double runLength = lineRunData.RunLength;
			double num2 = num - runLength;
			if (stairs.m_bHasTopLanding)
			{
				num2 = (num - runLength) / 2.0;
			}
			if (YJKRGeometry.Geometry.GreaterThan(landData.Width, num2))
			{
				if (stairs.m_bHasTopLanding)
				{
					num += (landData.Width - num2) * 2.0;
				}
				else
				{
					num += landData.Width - num2;
				}
				stairs.m_dStairsLength = num;
				num2 = landData.Width;
			}
			int num3 = stairs.m_nRunNum;
			if (!stairs.m_bHasTopLanding)
			{
				num3--;
			}
			for (int i = 0; i < num3; i++)
			{
				lstLandingWidth.Add(num2);
			}
			XYZ xyz = new XYZ(0.0, 0.0, 0.0);
			if (stairs.m_bHasTopLanding)
			{
				xyz = new XYZ(0.0, num2, 0.0);
			}
			XYZ xyz2 = new XYZ(lineRunData.RunWidth, 0.0, 0.0);
			XYZ xyz3 = new XYZ(stairs.m_dWellWidth, 0.0, 0.0);
			XYZ xyz4 = new XYZ(0.0, lineRunData.RunLength, 0.0);
			XYZ xyz5 = XYZ.Zero;
			xyz5 += xyz;
			XYZ xyz6 = xyz5 + xyz2;
			XYZ xyz7 = xyz5 + xyz4;
			XYZ xyz8 = xyz6 + xyz4;
			lineRunData.PtRunBottomLeft = xyz5;
			lineRunData.PtRunBottomRight = xyz6;
			lineRunData.PtRunTopLeft = xyz7;
			lineRunData.PtRunTopRight = xyz8;
			stairs.m_lstRunData[3] = lineRunData;
			LineRunData lineRunData2 = lstRunData[2];
			xyz4 = new XYZ(0.0, lineRunData2.RunLength, 0.0);
			xyz7 = xyz8 + xyz3;
			xyz8 = xyz7 + xyz2;
			xyz5 = xyz7 - xyz4;
			xyz6 = xyz8 - xyz4;
			lineRunData2.PtRunBottomLeft = xyz5;
			lineRunData2.PtRunBottomRight = xyz6;
			lineRunData2.PtRunTopLeft = xyz7;
			lineRunData2.PtRunTopRight = xyz8;
			stairs.m_lstRunData[2] = lineRunData2;
			num2 = num - lineRunData2.RunLength - lstLandingWidth[2];
			if (YJKRGeometry.Geometry.GreaterThan(landData.Width, num2))
			{
				num2 = landData.Width;
			}
			lstLandingWidth[1] = num2;
			this.Cal1And2RunPositionRightUp(ref stairs, ref lstLandingWidth, xyz5);
		}

		private void CalcRectLandTopPosRightUp(MultiRunStairs stairs, List<double> lstLandingWidth, ref List<List<XYZ>> lstlstLandingPos)
		{
			List<LineRunData> lstRunData = stairs.m_lstRunData;
			XYZ xyz = new XYZ(0.0, lstLandingWidth[0], 0.0);
			List<XYZ> list = new List<XYZ>();
			XYZ xyz2 = lstRunData[1].PtRunTopLeft + xyz;
			XYZ xyz3 = lstRunData[0].PtRunTopRight + xyz;
			list.Add(xyz2);
			list.Add(xyz3);
			lstlstLandingPos.Add(list);
			xyz = new XYZ(0.0, lstLandingWidth[1], 0.0);
			List<XYZ> list2 = new List<XYZ>();
			xyz2 = lstRunData[1].PtRunBottomLeft - xyz;
			xyz3 = lstRunData[2].PtRunBottomRight - xyz;
			list2.Add(xyz2);
			list2.Add(xyz3);
			lstlstLandingPos.Add(list2);
			if (lstLandingWidth.Count >= 3)
			{
				xyz = new XYZ(0.0, lstLandingWidth[2], 0.0);
				List<XYZ> list3 = new List<XYZ>();
				xyz3 = lstRunData[2].PtRunTopRight + xyz;
				xyz = new XYZ(lstRunData[2].RunWidth * 2.0 + stairs.m_dWellWidth, 0.0, 0.0);
				xyz2 = xyz3 - xyz;
				list3.Add(xyz2);
				list3.Add(xyz3);
				lstlstLandingPos.Add(list3);
			}
			if (lstLandingWidth.Count == 4)
			{
				xyz = new XYZ(0.0, lstLandingWidth[3], 0.0);
				List<XYZ> list4 = new List<XYZ>();
				xyz2 = lstRunData[3].PtRunBottomLeft - xyz;
				xyz = new XYZ(lstRunData[3].RunWidth * 2.0 + stairs.m_dWellWidth, 0.0, 0.0);
				xyz3 = xyz2 + xyz;
				list4.Add(xyz2);
				list4.Add(xyz3);
				lstlstLandingPos.Add(list4);
			}
		}

		private void DrawMultiRunStairsRunCurves(ref MultiRunStairs param_stairs, bool bDrawNoteInfo)
		{
			List<LineRunData> lstRunData = param_stairs.m_lstRunData;
			SingleRunCurveInfo singleRunCurveInfo = new SingleRunCurveInfo();
			singleRunCurveInfo.BottomElevation = lstRunData[0].BottomElevation;
			base.DrawLinearRun(lstRunData[0], lstRunData[0].PtRunBottomLeft, lstRunData[0].PtRunBottomRight, lstRunData[0].PtRunTopRight, lstRunData[0].PtRunTopLeft, ref singleRunCurveInfo, ref param_stairs.m_listOtherCurve, bDrawNoteInfo);
			param_stairs.m_listRunCurve.Add(singleRunCurveInfo);
			singleRunCurveInfo = new SingleRunCurveInfo();
			singleRunCurveInfo.BottomElevation = lstRunData[1].BottomElevation;
			base.DrawLinearRun(lstRunData[1], lstRunData[1].PtRunTopRight, lstRunData[1].PtRunTopLeft, lstRunData[1].PtRunBottomLeft, lstRunData[1].PtRunBottomRight, ref singleRunCurveInfo, ref param_stairs.m_listOtherCurve, bDrawNoteInfo);
			param_stairs.m_listRunCurve.Add(singleRunCurveInfo);
			singleRunCurveInfo = new SingleRunCurveInfo();
			singleRunCurveInfo.BottomElevation = lstRunData[2].BottomElevation;
			base.DrawLinearRun(lstRunData[2], lstRunData[2].PtRunBottomLeft, lstRunData[2].PtRunBottomRight, lstRunData[2].PtRunTopRight, lstRunData[2].PtRunTopLeft, ref singleRunCurveInfo, ref param_stairs.m_listOtherCurve, bDrawNoteInfo);
			param_stairs.m_listRunCurve.Add(singleRunCurveInfo);
			if (lstRunData.Count == 4)
			{
				singleRunCurveInfo = new SingleRunCurveInfo();
				singleRunCurveInfo.BottomElevation = lstRunData[3].BottomElevation;
				base.DrawLinearRun(lstRunData[3], lstRunData[3].PtRunTopRight, lstRunData[3].PtRunTopLeft, lstRunData[3].PtRunBottomLeft, lstRunData[3].PtRunBottomRight, ref singleRunCurveInfo, ref param_stairs.m_listOtherCurve, bDrawNoteInfo);
				param_stairs.m_listRunCurve.Add(singleRunCurveInfo);
			}
		}

		private void DrawMultiRunStairsLandingCurvesLeftUp(ref MultiRunStairs param_stairs, List<List<XYZ>> lstlstLandingPt)
		{
			BaseLandingData landData = param_stairs.m_LandData;
			List<LineRunData> lstRunData = param_stairs.m_lstRunData;
			new XYZ(param_stairs.GetStairsWellWidth(), 0.0, 0.0);
			List<CurveInfo> list = new List<CurveInfo>();
			List<XYZ> list2 = new List<XYZ>();
			list2.Add(lstRunData[0].PtRunTopLeft);
			list2.Add(lstlstLandingPt[0][0]);
			list2.Add(lstlstLandingPt[0][1]);
			list2.Add(lstRunData[1].PtRunTopRight);
			this.DrawMultiRunStairsLandingCurves(param_stairs, list2, ref list);
			double bottomElevation = lstRunData[0].RunHeight;
			LandingCurveInfo item = new LandingCurveInfo(list, bottomElevation);
			param_stairs.m_listLandCurve.Add(item);
			list2.Clear();
			list2.Add(lstRunData[1].PtRunBottomRight);
			list2.Add(lstlstLandingPt[1][1]);
			list2.Add(lstlstLandingPt[1][0]);
			list2.Add(lstRunData[2].PtRunBottomLeft);
			list.Clear();
			this.DrawMultiRunStairsLandingCurves(param_stairs, list2, ref list);
			bottomElevation = lstRunData[0].RunHeight + lstRunData[1].RunHeight;
			item = new LandingCurveInfo(list, bottomElevation);
			param_stairs.m_listLandCurve.Add(item);
			if (lstlstLandingPt.Count >= 3)
			{
				list2.Clear();
				XYZ xyz = XYZ.Zero;
				if (lstlstLandingPt.Count == 3 && lstRunData.Count == 3)
				{
					xyz = new XYZ(0.0, ConstValueManager.StairsTopLandOffset, 0.0);
				}
				list2.Add(lstRunData[2].PtRunTopLeft + xyz);
				list2.Add(lstlstLandingPt[2][0] + xyz);
				list2.Add(lstlstLandingPt[2][1] + xyz);
				XYZ xyz2 = new XYZ(param_stairs.m_dStairsWidth, 0.0, 0.0);
				list2.Add(lstRunData[2].PtRunTopLeft + xyz2 + xyz);
				list.Clear();
				this.DrawMultiRunStairsLandingCurves(param_stairs, list2, ref list);
				bottomElevation = lstRunData[0].RunHeight + lstRunData[1].RunHeight + lstRunData[2].RunHeight;
				item = new LandingCurveInfo(list, bottomElevation);
				param_stairs.m_listLandCurve.Add(item);
			}
			if (lstlstLandingPt.Count == 4)
			{
				list2.Clear();
				XYZ xyz3 = new XYZ(0.0, -ConstValueManager.StairsTopLandOffset, 0.0);
				list2.Add(lstRunData[3].PtRunBottomRight + xyz3);
				list2.Add(lstlstLandingPt[3][1] + xyz3);
				list2.Add(lstlstLandingPt[3][0] + xyz3);
				XYZ xyz4 = new XYZ(param_stairs.m_dStairsWidth, 0.0, 0.0);
				list2.Add(lstRunData[3].PtRunBottomRight - xyz4 + xyz3);
				list.Clear();
				this.DrawMultiRunStairsLandingCurves(param_stairs, list2, ref list);
				bottomElevation = lstRunData[0].RunHeight + lstRunData[1].RunHeight + lstRunData[2].RunHeight + lstRunData[3].RunHeight;
				item = new LandingCurveInfo(list, bottomElevation);
				param_stairs.m_listLandCurve.Add(item);
			}
		}

		private void DrawMultiRunStairsLandingCurvesRightUp(ref MultiRunStairs param_stairs, List<List<XYZ>> lstlstLandingPt)
		{
			BaseLandingData landData = param_stairs.m_LandData;
			List<LineRunData> lstRunData = param_stairs.m_lstRunData;
			new XYZ(param_stairs.GetStairsWellWidth(), 0.0, 0.0);
			List<CurveInfo> list = new List<CurveInfo>();
			List<XYZ> list2 = new List<XYZ>();
			list2.Add(lstRunData[0].PtRunTopRight);
			list2.Add(lstlstLandingPt[0][1]);
			list2.Add(lstlstLandingPt[0][0]);
			list2.Add(lstRunData[1].PtRunTopLeft);
			this.DrawMultiRunStairsLandingCurves(param_stairs, list2, ref list);
			double bottomElevation = lstRunData[0].RunHeight;
			LandingCurveInfo item = new LandingCurveInfo(list, bottomElevation);
			param_stairs.m_listLandCurve.Add(item);
			list2.Clear();
			list2.Add(lstRunData[1].PtRunBottomLeft);
			list2.Add(lstlstLandingPt[1][0]);
			list2.Add(lstlstLandingPt[1][1]);
			list2.Add(lstRunData[2].PtRunBottomRight);
			list.Clear();
			this.DrawMultiRunStairsLandingCurves(param_stairs, list2, ref list);
			bottomElevation = lstRunData[0].RunHeight + lstRunData[1].RunHeight;
			item = new LandingCurveInfo(list, bottomElevation);
			param_stairs.m_listLandCurve.Add(item);
			if (lstlstLandingPt.Count >= 3)
			{
				list2.Clear();
				XYZ xyz = XYZ.Zero;
				if (lstlstLandingPt.Count == 3 && lstRunData.Count == 3)
				{
					xyz = new XYZ(0.0, ConstValueManager.StairsTopLandOffset, 0.0);
				}
				list2.Add(lstRunData[2].PtRunTopRight + xyz);
				list2.Add(lstlstLandingPt[2][1] + xyz);
				list2.Add(lstlstLandingPt[2][0] + xyz);
				XYZ xyz2 = new XYZ(param_stairs.m_dStairsWidth, 0.0, 0.0);
				list2.Add(lstRunData[2].PtRunTopRight - xyz2 + xyz);
				list.Clear();
				this.DrawMultiRunStairsLandingCurves(param_stairs, list2, ref list);
				bottomElevation = lstRunData[0].RunHeight + lstRunData[1].RunHeight + lstRunData[2].RunHeight;
				item = new LandingCurveInfo(list, bottomElevation);
				param_stairs.m_listLandCurve.Add(item);
			}
			if (lstlstLandingPt.Count == 4)
			{
				list2.Clear();
				XYZ xyz3 = new XYZ(0.0, -ConstValueManager.StairsTopLandOffset, 0.0);
				list2.Add(lstRunData[3].PtRunBottomLeft + xyz3);
				list2.Add(lstlstLandingPt[3][0] + xyz3);
				list2.Add(lstlstLandingPt[3][1] + xyz3);
				XYZ xyz4 = new XYZ(param_stairs.m_dStairsWidth, 0.0, 0.0);
				list2.Add(lstRunData[3].PtRunBottomLeft + xyz4 + xyz3);
				list.Clear();
				this.DrawMultiRunStairsLandingCurves(param_stairs, list2, ref list);
				bottomElevation = lstRunData[0].RunHeight + lstRunData[1].RunHeight + lstRunData[2].RunHeight + lstRunData[3].RunHeight;
				item = new LandingCurveInfo(list, bottomElevation);
				param_stairs.m_listLandCurve.Add(item);
			}
		}

		private void DrawMultiRunStairsLandingCurves(MultiRunStairs param_stairs, List<XYZ> arLandPoints, ref List<CurveInfo> landCurveLoop)
		{
			BaseLandingData landData = param_stairs.m_LandData;
			landCurveLoop.Add(base.NewLine(PenColor.PC_Black, DashStyle.Solid, 2f, arLandPoints[2], arLandPoints[3], null));
			landCurveLoop.Add(base.NewLine(PenColor.PC_Black, DashStyle.Solid, 2f, arLandPoints[3], arLandPoints[0], null));
			landCurveLoop.Add(base.NewLine(PenColor.PC_Black, DashStyle.Solid, 2f, arLandPoints[0], arLandPoints[1], null));
			if (landData.TheType == LandingType.LT_Sector)
			{
				XYZ xyz = YJKStairs.CommonUnit.Geometry.CalculatMidPoint(arLandPoints[1], arLandPoints[2]);
				XYZ xyz2 = arLandPoints[1] - arLandPoints[0];
				xyz2 = xyz2.Normalize();
				xyz2 = xyz2 * param_stairs.m_dStairsWidth / 2.0;
				XYZ ptM = xyz + xyz2;
				landCurveLoop.Add(base.NewArc(PenColor.PC_Gray, DashStyle.Solid, 2f, arLandPoints[1], arLandPoints[2], ptM));
				return;
			}
			landCurveLoop.Add(base.NewLine(PenColor.PC_Black, DashStyle.Solid, 2f, arLandPoints[1], arLandPoints[2], null));
		}

		private void DrawMultiRunStairsBeamCurves(ref MultiRunStairs param_stairs, bool bLeftSideUp, bool bBottom, bool bMid, bool bTop)
		{
			List<LineRunData> lstRunData = param_stairs.m_lstRunData;
			double num = param_stairs.m_BeamData.BeamWidth / 2.0;
			num += lstRunData[0].RiserThickness;
			XYZ xyz = new XYZ(0.0, num, 0.0);
			XYZ xyz2 = new XYZ(param_stairs.m_dStairsWidth, 0.0, 0.0);
			XYZ ptS = XYZ.Zero;
			XYZ ptE = XYZ.Zero;
			if (bBottom)
			{
				List<CurveInfo> list = new List<CurveInfo>();
				ptS = lstRunData[0].PtRunBottomLeft + xyz;
				ptE = lstRunData[0].PtRunBottomRight + xyz;
				list.Add(base.NewLine(PenColor.PC_Gray, DashStyle.Solid, 1f, ptS, ptE, null));
				double bottomElevation = 0.0;
				BeamCurveInfo beamCurveInfo = new BeamCurveInfo(list, bottomElevation);
				beamCurveInfo.m_Type = BeamType.BT_Bottom;
				beamCurveInfo.m_nFloorNum = 0;
				param_stairs.m_listBeamCurve.Add(beamCurveInfo);
			}
			if (bMid)
			{
				List<CurveInfo> list = new List<CurveInfo>();
				list = new List<CurveInfo>();
				if (bLeftSideUp)
				{
					ptS = lstRunData[0].PtRunTopLeft + xyz;
					ptE = lstRunData[1].PtRunTopRight + xyz;
				}
				else
				{
					ptS = lstRunData[0].PtRunTopRight + xyz;
					ptE = lstRunData[1].PtRunTopLeft + xyz;
				}
				list.Add(base.NewLine(PenColor.PC_Gray, DashStyle.Solid, 1f, ptS, ptE, null));
				double bottomElevation2 = lstRunData[0].RunHeight;
				BeamCurveInfo beamCurveInfo2 = new BeamCurveInfo(list, bottomElevation2);
				beamCurveInfo2.m_Type = BeamType.BT_Mid;
				beamCurveInfo2.m_nFloorNum = 1;
				param_stairs.m_listBeamCurve.Add(beamCurveInfo2);
				list = new List<CurveInfo>();
				if (bLeftSideUp)
				{
					ptS = lstRunData[1].PtRunBottomRight - xyz;
					ptE = lstRunData[2].PtRunBottomLeft - xyz;
				}
				else
				{
					ptS = lstRunData[1].PtRunBottomLeft - xyz;
					ptE = lstRunData[2].PtRunBottomRight - xyz;
				}
				list.Add(base.NewLine(PenColor.PC_Gray, DashStyle.Solid, 1f, ptS, ptE, null));
				bottomElevation2 = lstRunData[0].RunHeight + lstRunData[1].RunHeight;
				beamCurveInfo2 = new BeamCurveInfo(list, bottomElevation2);
				beamCurveInfo2.m_Type = BeamType.BT_Mid;
				beamCurveInfo2.m_nFloorNum = 2;
				param_stairs.m_listBeamCurve.Add(beamCurveInfo2);
				if (lstRunData.Count == 4)
				{
					list = new List<CurveInfo>();
					if (bLeftSideUp)
					{
						ptS = lstRunData[2].PtRunTopLeft + xyz;
						ptE = lstRunData[3].PtRunTopRight + xyz;
					}
					else
					{
						ptS = lstRunData[2].PtRunTopRight + xyz;
						ptE = lstRunData[3].PtRunTopLeft + xyz;
					}
					list.Add(base.NewLine(PenColor.PC_Gray, DashStyle.Solid, 1f, ptS, ptE, null));
					bottomElevation2 = lstRunData[0].RunHeight + lstRunData[1].RunHeight + lstRunData[2].RunHeight;
					beamCurveInfo2 = new BeamCurveInfo(list, bottomElevation2);
					beamCurveInfo2.m_Type = BeamType.BT_Mid;
					beamCurveInfo2.m_nFloorNum = 3;
					param_stairs.m_listBeamCurve.Add(beamCurveInfo2);
				}
			}
			if (bTop)
			{
				List<CurveInfo> list = new List<CurveInfo>();
				double bottomElevation3;
				if (param_stairs.m_bHasTopLanding)
				{
					if (lstRunData.Count == 3)
					{
						list = new List<CurveInfo>();
						if (bLeftSideUp)
						{
							ptS = lstRunData[2].PtRunTopLeft + xyz;
							ptE = lstRunData[2].PtRunTopLeft + xyz + xyz2;
						}
						else
						{
							ptS = lstRunData[2].PtRunTopRight + xyz;
							ptE = lstRunData[2].PtRunTopRight + xyz - xyz2;
						}
						bottomElevation3 = lstRunData[0].RunHeight + lstRunData[1].RunHeight + lstRunData[2].RunHeight;
					}
					else
					{
						list = new List<CurveInfo>();
						if (bLeftSideUp)
						{
							ptS = lstRunData[3].PtRunBottomRight - xyz;
							ptE = lstRunData[3].PtRunBottomRight - xyz - xyz2;
						}
						else
						{
							ptS = lstRunData[3].PtRunBottomLeft - xyz;
							ptE = lstRunData[3].PtRunBottomLeft - xyz + xyz2;
						}
						bottomElevation3 = lstRunData[0].RunHeight + lstRunData[1].RunHeight + lstRunData[2].RunHeight + lstRunData[3].RunHeight;
					}
				}
				else if (lstRunData.Count == 3)
				{
					list = new List<CurveInfo>();
					ptS = lstRunData[2].PtRunTopRight + xyz;
					ptE = lstRunData[2].PtRunTopLeft + xyz;
					bottomElevation3 = lstRunData[0].RunHeight + lstRunData[1].RunHeight + lstRunData[2].RunHeight;
				}
				else
				{
					list = new List<CurveInfo>();
					ptS = lstRunData[3].PtRunBottomRight - xyz;
					ptE = lstRunData[3].PtRunBottomLeft - xyz;
					bottomElevation3 = lstRunData[0].RunHeight + lstRunData[1].RunHeight + lstRunData[2].RunHeight + lstRunData[3].RunHeight;
				}
				list.Add(base.NewLine(PenColor.PC_Gray, DashStyle.Solid, 1f, ptS, ptE, null));
				BeamCurveInfo beamCurveInfo3 = new BeamCurveInfo(list, bottomElevation3);
				beamCurveInfo3.m_Type = BeamType.BT_Top;
				beamCurveInfo3.m_nFloorNum = 0;
				param_stairs.m_listBeamCurve.Add(beamCurveInfo3);
			}
		}

		private void DrawUpStairsNoteInfo(ref MultiRunStairs param_stairs, bool bLeftSideUp)
		{
			List<LineRunData> lstRunData = param_stairs.m_lstRunData;
			LineRunData lineRunData = lstRunData[lstRunData.Count - 2];
			LineRunData lineRunData2 = lstRunData[lstRunData.Count - 1];
			XYZ xyz = XYZ.BasisY * 1.3;
			List<UpDownText> list = new List<UpDownText>();
			string sText = "上";
			string sText2 = "下";
			XYZ pos = YJKStairs.CommonUnit.Geometry.CalculatMidPoint(lineRunData.PtRunBottomLeft, lineRunData.PtRunBottomRight) - xyz;
			XYZ pos2 = YJKStairs.CommonUnit.Geometry.CalculatMidPoint(lineRunData2.PtRunBottomLeft, lineRunData2.PtRunBottomRight) - xyz;
			if (param_stairs.m_nRunNum == 3)
			{
				pos = YJKStairs.CommonUnit.Geometry.CalculatMidPoint(lineRunData.PtRunTopLeft, lineRunData.PtRunTopRight) + xyz;
				pos2 = YJKStairs.CommonUnit.Geometry.CalculatMidPoint(lineRunData2.PtRunTopLeft, lineRunData2.PtRunTopRight) + xyz;
			}
			UpDownText item = new UpDownText(pos, sText);
			list.Add(item);
			item = new UpDownText(pos2, sText2);
			list.Add(item);
			base.DrawUpDownNoteInfo(ref param_stairs.m_listText, list);
		}

		private void DrawMultiRunStairsNoteInfo(ref MultiRunStairs param_stairs, List<List<XYZ>> lstlstLandingPt, bool bLeftUp)
		{
			List<LineRunData> lstRunData = param_stairs.m_lstRunData;
			BaseLandingData landData = param_stairs.m_LandData;
			double dStairsWidth = param_stairs.m_dStairsWidth;
			XYZ xyz = XYZ.BasisY * 2.0;
			XYZ xyz2 = XYZ.BasisX * 2.0;
			int count = lstlstLandingPt.Count;
			XYZ xyz3 = lstlstLandingPt[0][0];
			XYZ xyz4 = lstlstLandingPt[0][1];
			XYZ xyz5 = XYZ.Zero;
			XYZ xyz6 = XYZ.Zero;
			XYZ xyz7 = new XYZ(0.0, dStairsWidth / 2.0, 0.0);
			xyz5 = xyz3 + xyz;
			xyz6 = xyz4 + xyz;
			if (landData.TheType == LandingType.LT_Sector)
			{
				xyz5 += xyz7;
				xyz6 += xyz7;
			}
			base.DrawStairsNoteInfo(ref param_stairs.m_listOtherCurve, ref param_stairs.m_listText, xyz5, xyz6, "梯间宽度", 0.8, 5.0, 2.0, XYZ.BasisY, PenColor.PC_Black);
			xyz5 = xyz3 - xyz2;
			xyz6 = lstlstLandingPt[1][0] - xyz2;
			base.DrawStairsNoteInfo(ref param_stairs.m_listOtherCurve, ref param_stairs.m_listText, xyz5, xyz6, "梯间长度", 0.8, 2.0, 5.0, -XYZ.BasisX, PenColor.PC_Black);
			this.DrawLandingNoteInfo(ref param_stairs, lstlstLandingPt, bLeftUp);
		}

		private void DrawLandingNoteInfo(ref MultiRunStairs param_stairs, List<List<XYZ>> lstlstLandingPt, bool bLeftUp)
		{
			XYZ ptStart = XYZ.Zero;
			XYZ ptEnd = XYZ.Zero;
			List<LineRunData> lstRunData = param_stairs.m_lstRunData;
			XYZ xyz = XYZ.BasisX * 2.0;
			new XYZ(param_stairs.m_dStairsWidth, 0.0, 0.0);
			if (bLeftUp)
			{
				ptStart = lstRunData[1].PtRunBottomRight + xyz;
				ptEnd = lstlstLandingPt[1][1] + xyz;
				base.DrawStairsNoteInfo(ref param_stairs.m_listOtherCurve, ref param_stairs.m_listText, ptStart, ptEnd, "平台宽度", 0.8, 2.0, 5.0, XYZ.BasisX, PenColor.PC_Black);
				ptStart = lstlstLandingPt[0][1] + xyz;
				ptEnd = lstRunData[1].PtRunTopRight + xyz;
				base.DrawStairsNoteInfo(ref param_stairs.m_listOtherCurve, ref param_stairs.m_listText, ptStart, ptEnd, "平台宽度", 0.8, 2.0, 5.0, XYZ.BasisX, PenColor.PC_Black);
				return;
			}
			ptStart = lstRunData[2].PtRunBottomRight + xyz;
			ptEnd = lstlstLandingPt[1][1] + xyz;
			base.DrawStairsNoteInfo(ref param_stairs.m_listOtherCurve, ref param_stairs.m_listText, ptStart, ptEnd, "平台宽度", 0.8, 2.0, 5.0, XYZ.BasisX, PenColor.PC_Black);
			ptStart = lstlstLandingPt[0][1] + xyz;
			ptEnd = lstRunData[0].PtRunTopRight + xyz;
			base.DrawStairsNoteInfo(ref param_stairs.m_listOtherCurve, ref param_stairs.m_listText, ptStart, ptEnd, "平台宽度", 0.8, 2.0, 5.0, XYZ.BasisX, PenColor.PC_Black);
		}

		public bool MultiRunStairsProfileCurves(ref MultiRunStairs stairs, bool bDrawNoteInfo, int basePointIndex, bool lrMirror, bool tbMirror, bool bLeftSideUp, double rotateAngle, bool bBottom, bool bMid, bool bTop)
		{
			bool result = true;
			double dStairsWidth = stairs.m_dStairsWidth;
			double dStairsLength = stairs.m_dStairsLength;
			List<double> lstLandingWidth = new List<double>();
			this.CalcRunPosition(ref stairs, ref lstLandingWidth, bLeftSideUp);
			this.CorrectLandWidth(ref stairs, ref lstLandingWidth);
			List<List<XYZ>> list = new List<List<XYZ>>();
			if (bLeftSideUp)
			{
				this.CalcRectLandTopPosLeftUp(stairs, lstLandingWidth, ref list);
			}
			else
			{
				this.CalcRectLandTopPosRightUp(stairs, lstLandingWidth, ref list);
			}
			if (list.Count < 2)
			{
				return false;
			}
			List<XYZ> list2 = new List<XYZ>();
			list2.AddRange(list[0]);
			list2.Add(list[1][1]);
			list2.Add(list[1][0]);
			if (bLeftSideUp)
			{
				this.SetStairsOutSupportPointsLeftUp(ref stairs, list);
			}
			else
			{
				this.SetStairsOutSupportPointsRightUp(ref stairs, list);
			}
			XYZ xyz = list2[basePointIndex];
			base.CalulateTransform(lrMirror, tbMirror, rotateAngle, dStairsWidth, dStairsLength, xyz);
			stairs.m_TransVector = YJKStairs.CommonUnit.Geometry.TransformPoint(xyz, this.m_Transform);
			stairs.m_listOtherCurve.AddRange(base.DrawBasePoint(xyz, 100.0));
			stairs.m_Transform = this.m_Transform;
			this.DrawMultiRunStairsRunCurves(ref stairs, bDrawNoteInfo);
			if (bLeftSideUp)
			{
				this.DrawMultiRunStairsLandingCurvesLeftUp(ref stairs, list);
			}
			else
			{
				this.DrawMultiRunStairsLandingCurvesRightUp(ref stairs, list);
			}
			this.DrawMultiRunStairsBeamCurves(ref stairs, bLeftSideUp, bBottom, bMid, bTop);
			if (bDrawNoteInfo)
			{
				this.DrawUpStairsNoteInfo(ref stairs, bLeftSideUp);
			}
			this.DrawMultiRunStairsNoteInfo(ref stairs, list, bLeftSideUp);
			return result;
		}
	}
}
